Public Class BoldAndItalic

    Private Sub BoldAndItalic_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub BoldAndItalic_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Const str1 = "Đây là Font chữ  "
        Const str2 = "Bold"
        Const str3 = " Còn đây là Font nghiêng "
        Const str4 = "Italic"
        Const str5 = " HẾT !."
        Dim brush As Brush = New SolidBrush(Color.Black)
        Dim fontRegular As Font = Font
        Dim fontBold As Font = New Font(fontRegular, FontStyle.Bold)
        Dim fontItalic As Font = New Font(fontRegular, FontStyle.Italic)
        Dim x As Single = 0
        Dim y As Single = 0

         e.Graphics.DrawString(str1, fontRegular, brush, x, y)
        x += e.Graphics.MeasureString(str1, fontRegular).Width()

        e.Graphics.DrawString(str2, fontBold, brush, x, y)
        x += e.Graphics.MeasureString(str2, fontBold).Width

        e.Graphics.DrawString(str3, fontRegular, brush, x, y)
          x += e.Graphics.MeasureString(str3, fontRegular).Width()

        e.Graphics.DrawString(str4, fontItalic, brush, x, y)
          x += e.Graphics.MeasureString(str4, fontItalic).Width()

        e.Graphics.DrawString(str5, fontRegular, brush, x, y)
    End Sub
End Class
